import httpUtil from '../utils/request'

export function dbConfigPage(db,page,limit){
    const params = {
        db,
        page,
        limit
    }
    return httpUtil({
        url: '/db/config/page',
        method: 'get',
        params: params
    })
}

export function dbConfigAdd(data){
    return httpUtil({
        url: '/db/config/add',
        method: 'post',
        data: data
    })
}

export function dbConfigList(){
    return httpUtil({
        url: '/db/config/list',
        method: 'get'
    })
}

export function dbConfigDel(dbs){
    const data = {
        dbs
    }
    return httpUtil({
        url: '/db/config/del',
        method: 'post',
        data:data
    })
}

export function dbType(){
    return httpUtil({
        url: '/db/config/dbType',
        method: 'get'
    })
}

export function dbConfigUpdate(params){
    const data = {
        db:params.db,
        jdbcUrl:params.jdbcUrl,
        driverClass:params.driverClass,
    }
    return httpUtil({
        url: '/db/config/update',
        method: 'post',
        data: data
    })
}